package br.com.skytef.beans.WEB;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.skytef.dao.EstoqueDao;
import br.com.skytef.entity.StatusEstoqueEntity;

@ManagedBean(name="ListaStatusEstoqueBean")
@RequestScoped
public class ListaStatusEstoqueBean {

	private List <StatusEstoqueEntity> listaFiltrados;
	public List <StatusEstoqueEntity> getListaFiltrados() {return listaFiltrados;}
	public void setListaFiltrados(List <StatusEstoqueEntity> listaFiltrados) {this.listaFiltrados = listaFiltrados;}

	private List<StatusEstoqueEntity> listaStatus;
	public List<StatusEstoqueEntity> getListaStatus() {return listaStatus;}
	public void setListaStatus(List<StatusEstoqueEntity> listaStatus) {this.listaStatus = listaStatus;}
	
	public ListaStatusEstoqueBean() throws Exception {
		super();
		this.buscarStatusEstoque();
	}
	
	public void listarEstoque() throws Exception {
		this.buscarStatusEstoque();
	}
					
	@PostConstruct
	public void init() throws Exception {
		this.buscarStatusEstoque();
	}
	
	public void buscarStatusEstoque() throws SQLException, Exception {		
		listaStatus = new EstoqueDao().mostraStatus();
	}

}